from django.conf.urls import url, include
from app01.views import project, home, account, manage, wiki

urlpatterns = [
    url(r'^test/$', account.test, name='test'),
    url(r'^register.html/', account.register, name='register'),
    url(r'^sms/', account.sms, name='sms'),
    url(r'^login_sms/', account.login_sms, name='login_sms'),
    url(r'^login/', account.login, name='login'),
    url(r'^image/', account.image, name='image'),
    url(r'^logout/', account.logout, name='logout'),

    url(r'^index/', home.index, name='index'),

    # 项目管理
    url(r'^project/$', project.project, name='project'),
    url(r'^project/star/(?P<project_type>\w+)/(?P<project_id>\w+)/$', project.project_star, name='project_star'),
    url(r'^project/unstar/(?P<project_type>\w+)/(?P<project_id>\w+)/$', project.project_unstar, name='project_unstar'),


    url(r'^manage/(?P<project_id>\d+)/', include([
        url(r'^dashboard/$', manage.dashboard, name='dashboard'),
        url(r'^issues/$', manage.issues, name='issues'),
        url(r'^statistics/$', manage.statistics, name='statistics'),
        url(r'^file/$', manage.file, name='file'),

        url(r'^wiki/$', wiki.wiki, name='wiki'),
        url(r'^wiki/add/$', wiki.wiki_add, name='wiki_add'),
        url(r'^wiki/catalog/$', wiki.wiki_catalog, name='wiki_catalog'),
        url(r'^wiki/delete/(?P<wiki_id>\d+)$', wiki.wiki_delete, name='wiki_delete'),
        url(r'^wiki/edit/(?P<wiki_id>\d+)$', wiki.wiki_edit, name='wiki_edit'),

        url(r'^setting/$', manage.setting, name='setting'),
    ]))


]
